package com.example.springbootfirst.dto;

import lombok.Data;

/**
 * created by Morgan on 2021/9/30
 */
@Data
public class ResponseDto<T> {
    private String code;
    private String msg;
    private T data;

    public ResponseDto() {
        this(null,null,null);
    }

    public ResponseDto(String code,String msg,T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public static <T> ResponseDto<T> getSuccessResponseDto(T data) {
        return new ResponseDto<T>("200","操作成功",data);
    }
}
